home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
windownt
/
perlnt.zip
/
t
/
io
/
fs.nt
< prev
next >
Wrap
Text File
|
1993-07-25
|
2KB
|
74 lines
#!./perl
# $RCSfile: fs.t,v $$Revision: 4.0.1.1 $$Date: 1993/02/05 19:44:34 $
print "1..10\n";
$wd = `cd`;
chop($wd);
if (-d 'tmp') {
@tmp = <tmp/*>;
foreach (@tmp) {
unlink($_);
}
rmdir('tmp');
}
`mkdir tmp`;
chdir '.\\tmp';
`del/s/f/q a b c x`;
open(fh,'>x') || die "Can't create x";
close(fh);
open(fh,'>a') || die "Can't create a";
close(fh);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('a');
print "ok 1\n";
if (($mode & 0777) == 0666) {print "ok 2\n";} else {print "not ok 2\n";}
if ((chmod 0444,'a') == 1) {print "ok 3\n";} else {print "not ok 3\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('a');
if (($mode & 0777) == 0444) {print "ok 4\n";} else {print "not ok 4\n";}
if ((unlink 'x') == 1) {print "ok 5\n";} else {print "not ok 5\n";}
if (rename('a','b')) {print "ok 6\n";} else {print "not ok 6\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('a');
if ($ino == 0) {print "ok 7\n";} else {print "not ok 7\n";}
if ((chmod 0666,'b') == 1) {print "ok 8\n";} else {print "not ok 8\n";}
#$foo = (utime 500000000,500000001,'b');
#if ($foo == 1) {print "ok 16\n";} else {print "not ok 16 $foo\n";}
#($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
# $blksize,$blocks) = stat('b');
#if ($dev) {print "ok 17\n";} else {print "not ok 17\n";}
#if ($atime == 500000000 && $mtime == 500000001)
# {print "ok 18\n";}
#else
# {print "not ok 18 $atime $mtime\n";}
if ((unlink 'b') == 1) {print "ok 9\n";} else {print "not ok 9\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('b');
if ($ino == 0) {print "ok 10\n";} else {print "not ok 10\n";}
unlink 'c';
chdir $wd || die "Can't cd back to $wd";
unlink 'c';